package com.ruoyi.eqmonitor.smdtv.service.impl;

import java.io.FileInputStream;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.eqmonitor.smdtv.domain.Smdtv14;
import com.ruoyi.eqmonitor.smdtv.mapper.Smdtv14Mapper;
import com.ruoyi.eqmonitor.smdtv.mapper.SmregisterMapper;
import com.ruoyi.eqmonitor.smdtv.service.ISmdtv14Service;
import com.ruoyi.eqmonitor.utils.Constant;
import com.ruoyi.eqmonitor.utils.FileUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;


/**
 * 【请填写功能名称】Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-03-06
 */
@Service
public class Smdtv14ServiceImpl extends ServiceImpl<Smdtv14Mapper, Smdtv14> implements ISmdtv14Service {
    
    @Resource
    private Smdtv14Mapper smdtv14Mapper;

    @Resource
    private SmregisterMapper smregisterMapper;

    @Override
    public Smdtv14 selectSmdtv14ByFid(Long fid){
        return smdtv14Mapper.selectSmdtv14ByFid(fid,smregisterMapper.getTableNameByDatasetName(Constant.Smregister.SMDTV_14.getName()));
    }
      
    @Override
    public List<Smdtv14> selectSmdtv14List(Smdtv14 smdtv14,Integer pageNum,Integer pageSize){
        return smdtv14Mapper.selectSmdtv14List(smdtv14,
                smregisterMapper.getTableNameByDatasetName(Constant.Smregister.SMDTV_14.getName()),
                pageNum,
                pageSize);
    }

    @Override
    public Long getTotal(Smdtv14 smdtv14) {
        return smdtv14Mapper.getTotal(smdtv14,
                smregisterMapper.getTableNameByDatasetName(Constant.Smregister.SMDTV_14.getName()));
    }

    @Override
    public boolean save(Smdtv14 smdtv14) {
        return smdtv14Mapper.save(smdtv14,smregisterMapper.getTableNameByDatasetName(Constant.Smregister.SMDTV_14.getName())) > 0;
    }

    @Override
    public boolean updateById(Smdtv14 smdtv14) {
        return smdtv14Mapper.updateById(smdtv14,smregisterMapper.getTableNameByDatasetName(Constant.Smregister.SMDTV_14.getName())) > 0;
    }

    @Override
    public boolean removeByIds(List<Long> ids) {
        return smregisterMapper.removeByIds(ids,smregisterMapper.getTableNameByDatasetName(Constant.Smregister.SMDTV_14.getName())) > 0;
    }

}
